package com.ruoyi.yf.mapper;

import com.ruoyi.system.domain.SysUser;
import com.ruoyi.yf.domain.*;
import com.ruoyi.yf.domain.mobile.NoOutBoxInfo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;


public interface YfDisposeMapper {

    // 根据条码获取医废信息
    YfTag getYFInfoByYfCode(String codeId);

    // 根据条码查询医废
    YfTag selectYfTagByCodeId(String codeId);

    // 查询未出库的医废列表
    List<YfTag> getNoOutStoreYFlistByStagingId(@Param("userId") Long userId, @Param("stagingId") Long stagingId,
                                               @Param("ksId") Long ksId, @Param("day") String day);

    // 医废装箱，只有10 -> 20
    void yfBoxing(@Param("codeId") String codeId, @Param("boxCode") String boxCode,
                  @Param("userId") Long userId, @Param("date") Date date);

    // 取消医废装箱，只有20 -> 10
    void yfUnBox(@Param("codeId") String codeId, @Param("userId") Long userId);

    // 根据装箱码查询箱内医废
    List<YfTag> getYFByBoxCode(@Param("userId") Long userId, @Param("hospitalId") Long hospitalId,
                               @Param("stagingId") Long stagingId, @Param("boxCode") String boxCode);

    // 查询未装箱袋数、重量；装箱未出库袋数、重量、箱数
    NoOutBoxInfo getNoOutBoxInfo(@Param("userId") Long userId, @Param("hospitalId") Long hospitalId,
                                 @Param("stagingId") Long stagingId);

    // 查询已装箱未出库箱子列表
    List<YfBox> getBoxedNoOutBoxList(@Param("userId")Long userId, @Param("hospitalId")Long hospitalId,
                                     @Param("stagingId")Long stagingId);

    // 封箱
    void sealingBox(@Param("userId")Long userId, @Param("boxCode")String boxCode, @Param("date")Date date);

    // 根据箱码查询箱码内统计
    YfBox getInBoxYFPrintByBoxCode(@Param("userId")Long userId, @Param("boxCode")String boxCode);

    // 根据暂存点id获取未装箱医废
    List<YfTag> getNoBoxedYFByStagingId(@Param("userId") Long userId, @Param("stagingId") Long stagingId,
                                        @Param("ksId") Long ksId, @Param("day") String day);

    // 查询封箱未装车箱子列表
    List<YfBox> getSealingBoxedNoOutBoxList(@Param("userId") Long userId, @Param("hospitalId") Long hospitalId,
                                            @Param("stagingId") Long stagingId);

    // 按暂存点查询当天出库箱子列表
    List<YfBox> getTodayOutYFBoxList(@Param("userId") Long userId, @Param("hospitalId") Long hospitalId,
                                     @Param("stagingId") Long stagingId);

    // 获取医废车列表
    List<YfTruck> getYFTruckList(@Param("userId") Long userId, @Param("disposalId")Long disposalId);

    // 按医废车及押运员查询当天装车箱子列表
    List<YfBox> getTodayTruckedYFBoxList(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                         @Param("truckId")Long truckId);

    // 取消医废箱装车
    void yfBoxUnTruck(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                   @Param("boxCode")String boxCode);

    // 根据箱码查询医废箱
    YfBox selectYfBoxByBoxCode(String boxCode);

    // 医废箱装车
    void yfBoxTrucking(@Param("userId")Long userId,@Param("disposalId") Long disposalId,
                       @Param("truckId")Long truckId, @Param("boxCode")String boxCode,
                       @Param("date")Date date);

    // 巡检根据箱码查询医废箱信息
    YfBox getYFBoxInfoByBoxCode(String codeId);

    // 扫描诊所科室码查询诊所及科室信息
    YfDept getDeptInfoByScanCode(String deptId);

    // 查询当天处置公司去诊所收集医废汇总
    List<YfClinic> getCZTodayClinicYFTotal(@Param("userId")Long userId, @Param("disposalId")Long disposalId);

    // 获取当前用户收集未装箱装车医废列表
    List<YfTag> getCollNoTruckYFByCollUserId(@Param("userId")Long userId, @Param("disposalId")Long disposalId, @Param("yftype")String yftype);

    // 诊所医废封箱打印
    int saveCollToTruckYFlist(@Param("list")List<YfTag> list, @Param("userId")Long userId,
                              @Param("disposalId")Long disposalId, @Param("truckId")Long truckId,
                              @Param("boxCode")String boxCode, @Param("date")Date date);

    // 查询处置公司去诊所收医废未装箱汇总及今天封箱汇总
    NoOutBoxInfo getCZClinicBoxYFTotal(@Param("userId")Long userId, @Param("disposalId")Long disposalId);

    // 查询诊所收集未装箱医废列表 - 重复打印
    List<YfTag> getClinicCollYF(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                @Param("ksId")Long ksId, @Param("day")String day);

    // 根据押运员查询当天去医院收医废汇总
    List<YfBox> getCZTodaHospitalYFTotal(@Param("userId")Long userId, @Param("disposalId")Long disposalId);

    // 根据押运员查询今日诊所医废封箱列表
    List<YfBox> getTodayClinicSealingBoxList(@Param("userId")Long userId, @Param("disposalId")Long disposalId);

    // 根据装箱码查询箱内诊所医废
    List<YfTag> getClinicYFByBoxCode(@Param("userId")Long userId, @Param("disposalId")Long disposalId, @Param("boxCode")String boxCode);

    // 根据押运员查询今天装车医废箱列表
    List<YfBox> getTodayTruckYFBoxListByUserId(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                               @Param("hospitalId")Long hospitalId);

    // 获取押运员今日诊所收集医废汇总及报零
    List<YfBox> getClinicTodayYFTotalAndZeroByCollUserId(@Param("userId")Long userId, @Param("disposalId")Long disposalId);

    // 医疗机构报零
    void ClinicCollZeroByUserId(@Param("userId")Long userId, @Param("userName")String userName,
                                @Param("disposalId")Long disposalId, @Param("hospitalId")Long hospitalId);

    // 根据医院医废箱码查询箱内医废
    List<YfTag> getHospitalBoxYFListByBoxCode(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                              @Param("boxCode")String boxCode);

    // 根据扫描二维码查询医院信息
    YfBox getHospitalByhospitalId(@Param("hospitalId")Long hospitalId);

    // 查询医院未装车医废箱列表
    List<YfBox> getHospitalNoTruckYFBoxList(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                            @Param("hospitalId")Long hospitalId);

    // 查询医院已收集未装箱医废
    List<YfTag> getCollNoBoxYFByHospitalId(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                           @Param("hospitalId")Long hospitalId);

    // 查询诊所今日收集医废
    List<YfTag> getClinicTodayYFListByClinicId(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                               @Param("hospitalId")Long hospitalId);

    // 诊所医废装箱装车
    void clinicYFBoxingAndTrucking(@Param("codeId")String codeId, @Param("boxCode")String boxCode,
                                   @Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                   @Param("truckId")Long truckId, @Param("date")Date date);

    // 取消诊所医废装箱，只有30 -> 10
    void clinicYFUnBox(@Param("codeId")String codeId, @Param("userId")Long userId);

    // 查询诊所今日已装箱及全部未封箱医废箱列表
    List<YfBox> getClinicTodayBoxedYFAndNoSealingBoxList(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                        @Param("truckId")Long truckId);

    // 根据押运员查询当天去诊所装箱医废汇总
    NoOutBoxInfo getCZClinicTodaYFTotal(@Param("userId")Long userId, @Param("disposalId")Long disposalId);

    // 查询诊所未装箱医废列表
    List<YfTag> getClinicNoTruckYFList(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                       @Param("hospitalId")Long hospitalId);

    // 获取押运员今日诊所装箱医废汇总及报零
    List<YfBox> getClinicTodayBoxedYFTotalAndZero(@Param("userId")Long userId, @Param("disposalId")Long disposalId);

    // 根据押运员查询诊所今日装箱医废
    List<YfTag> getClinicTodayOutYFListByClinicId(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                                  @Param("hospitalId")Long hospitalId);

    // 根据医院id查询医院信息
    YfDept getHospitalInfoByHospitalId(@Param("userId")Long userId, @Param("code")String code);

    // 查看医院医废出库量
    List<YfBox> getHospitalYFOutTotal(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                      @Param("hospitalId")Long hospitalId,
                                      @Param("startDate")String startDate, @Param("endDate")String endDate);

    // 根据二维码查询医废车
    YfTruck getTruckByCode(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                           @Param("truckId")String truckId);

    // 根据二维码查询押运员
    SysUser getTruckerByCode(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                             @Param("truckerId")Long truckerId);


    // 入库 -> 出库装车
    void inStoreToOutStoreToTruckYF(@Param("codeId")String codeId, @Param("userId")Long userId,
                                    @Param("truckId")Long truckId, @Param("truckerId")Long truckerId);

    // 一键出库装车
    void oneKeyOutStoreToTruckYF(@Param("stagingId")Long stagingId, @Param("userId")Long userId,
                                 @Param("truckId")Long truckId, @Param("truckerId")Long truckerId);

    // 科室医废出库装车
    void oneKSInToOutStoreToTruckYF(@Param("stagingId")Long stagingId, @Param("ksId")Long ksId,
                                    @Param("userId")Long userId,
                                    @Param("truckId")Long truckId, @Param("truckerId")Long truckerId);

    // 选择出库装车
    int saveOutStoreToTruckYFlist(@Param("list")List<YfTag> yfList, @Param("userId")Long userId,
                                  @Param("truckId")Long truckId, @Param("truckerId")Long truckerId);

    // 查询1吨医废正负偏差值
    int getOneTonWeightDeviation();

    // 扫描医疗机构码查询医疗机构及医废暂存点信息
    YfDept getHospitalAndStagingInfoByScanCode(@Param("userId")Long userId, @Param("deptId")String deptId);

    // 处置公司批量上传医废接口
    int czcompanyBatchSaveYF(@Param("list")List<YfTag> list);

    // 根据处置公司用户及医废车及医疗机构查询医废(按出库用户)
    List<YfTag> getHospitalTodayYFListByUserAndTruckAndHospital(@Param("userId")Long userId,
                                                                @Param("disposalId")Long disposalId,
                                                                @Param("truckId")Long truckId,
                                                                @Param("hospitalId")Long hospitalId);

    // 根据押运员查询当天填报医院医废汇总
    List<YfBox> getCZTBTodayHospitalYFTotal(@Param("userId")Long userId, @Param("disposalId")Long disposalId);

    // 根据押运员及医废车查询医院装车医废列表
    List<YfBox> getTodayOneTruckedYFTotalByTruckerFill(@Param("userId")Long userId,
                                                       @Param("disposalId")Long disposalId,
                                                       @Param("truckId")Long truckId);

    // 查询医废车上未卸车0的医废是否有无箱码的情况
    int getIsTruckYFAllHaveBoxCodeByTruck(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                          @Param("truckId")Long truckId);

    // 查询车上未卸车或未转车医废
    YfBox getTruckedYFByTruckId(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                @Param("truckId")Long truckId);

    // 查询车上未卸车或未转车医废箱详情
    List<YfBox> getTruckedYFTotalOrBoxListByTruckId(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                                    @Param("truckId")Long truckId);

    // 小车剩余医废全部装入医废运输车
    void smallTruckYFInBigTruck(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                @Param("smallTruckId")Long smallTruckId, @Param("bigTruckId")Long bigTruckId);

    // 按箱小车医废装入大车
    void smallTruckOneBoxYFInBigTruck(@Param("userId")Long userId, @Param("disposalId")Long disposalId,
                                      @Param("smallTruckId")Long smallTruckId, @Param("bigTruckId")Long bigTruckId,
                                      @Param("boxCode")String boxCode);
}
